Lab Two-Dimensional Array

PURPOSE:

	Write a program that sum the elements in a two-dimensional array..

ALGORITHM

1.	*BASIC INFORMATION (5 points)

•	State your name, class, section, instructor’s name, assignment number,
and date.

2.	*DATA STRUCTURES  (10 points)

•	Describe the important variables in your program.  
•	For each of these variables give its type and a description of the usage in the program.  
•	Do not describe less important variable such as subscripts
and loop control variables.

3.	DATA MAIPULATION INSTRUCTIONS (25 points)
•	An algorithm requires instructions
•	Therefore, list the steps you will take to solve the problem.
 
4.	CONTROL STRUCTURES (15 points) 
•	Describe the controls statement used in the program.
•	How did the program solve the problem? 

6.	SOLUTION (20 points)
•	Add code to the statements below to solve the program.
		public class Magic_Square
{
public static void main (String [] args)
			{
			//Declares a two dimensional array
			final int rows=3, cols=3;
	    		int [][]Magic={ {1,2}, {3,3}, {4,5}};
	   		int i, j;
	   
	   		//Prints out the elements in the array
			for (i=0; i<Magic.length; i++)
		 	{	
		      		for (j=0; j<2;  j++)
		      		{
		      			System.out.print(Magic[i][j]+ " ");
		      		}	
		     		System.out.println();
		 	}
			System.out.println();
			 
			//Sums the element in the array
			{

			}
 		}

•	Run your program on http://sandbox.javawide.org website.
•	After running the program successfully, type the name of your program here.

7.	POSSIBLE IMPROVEMENTS (10 points)

•	Describe how you could improve the program if you had more time.  
•	What improvements would make the program faster, more general, simpler, or easier to understand?

8.	SUMMARY (15 points)

•	What is the algorithm for this lab?  
•	Do you understand the algorithm?
•	What questions do you have about the algorithm?
•	Submit Lab : Two-Dimensional Array Drop to the drop box.

9	APPENDIX
	
•	An algorithm is a set of steps that when applied to a problem solves the problem
•	Informally, an algorithm is any well-defined computational procedure that
takes some value, or set of values, and input and produces some value, or
set of values, as output.
•	An algorithm is thus a sequence of computational steps that transform the 
input into the output.
•	Well-designed algorithms have three key properties:  (1) precision,
(2) simplicity, (3) Levels of Abstraction
•	Algorithms need to be precise.
•	Each step of an algorithm must also be simple.
•	Algorithms should have levels of abstractions, ideas apart from the objects in your program (e. g. classes & methods).